package com.wodogs.recharge.battlenet;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.wd.core.spring.support.SpringUtils;
import com.wodogs.recharge.entity.UserAccount;
import com.wodogs.utils.BaseRunnable;

public class BattlenetRunnable extends BaseRunnable {
	
	private static final Log logger = LogFactory.getLog(BattlenetRunnable.class);

	private String login_url;
	
	private List<UserAccount> accountList;
	
	@Override
	public void run() {
		if(getAccountList() == null || getAccountList().size()<1){
			return;
		}
		try {
//			BattlenetManage manage = (BattlenetManage) SpringUtils.getBean("battlenetManage");
			BattlenetManage manage = new BattlenetManage();
			manage.loginAndRecharge(getAccountList());
		} catch (InterruptedException e) {
			logger.error(e.getMessage(), e);
			e.printStackTrace();
		}
		
	}

	public String getLogin_url() {
		return login_url;
	}

	public void setLogin_url(String login_url) {
		this.login_url = login_url;
	}

	public List<UserAccount> getAccountList() {
		return accountList;
	}

	public void setAccountList(List<UserAccount> accountList) {
		this.accountList = accountList;
	}

}
